package cmd

import (
	"gitee.com/kristas/booting-go/gen_tool/booctl/logic"
	"github.com/spf13/cobra"
)

var (
	debug bool
)

var genCmd = &cobra.Command{
	Use:     "generate [component]",
	Short:   "generate template function",
	Aliases: []string{"gen"},
	Run: func(cmd *cobra.Command, args []string) {
		err := logic.GenEntry(debug, args...)
		cobra.CheckErr(err)
	},
}

func init() {
	genCmd.Flags().BoolVarP(&debug, "debug", "d", false, "debug mode")
	rootCmd.AddCommand(genCmd)
}
